<?php $this->import('Header') ?>
<?php $this->import('Dog/TopInfo') ?>
<div class="container">
	<div class="well well-sm dog-info dog-photo">
		<p class="bg-title title">
			<span>Ta的照片</span>
			<a class="right" href="/dog/morephoto_<?php echo $userInfo['UserId'] ?>.html"><i class="glyphicon glyphicon-th-list"></i> 更多</a>
		</p>
		<div class="photo-box">
			<?php foreach ($photos as $p) { ?>
				<a href="/dog/photo/detail_<?php echo $p['PhotoId'] ?>.html" class="thumbnail"><img data-src="<?php echo \Util\User::getUserPhotoRectangle($p['Path'], 400) ?>"></a>
			<?php } ?>
		</div>
	</div>
</div>
<div class="container">
	<div class="well well-sm dog-info">
		<p class="bg-title title">
			<span>Ta的帖子</span>
			<a class="right" href="/dog/single_u<?php echo $userInfo['UserId'] ?>.html"><i class="glyphicon glyphicon-th-list"></i> 全部帖子</a>
		</p>
		<div class="row">
			<div class="col-xs-10">
				<?php if ($articles) { ?>
					<?php foreach ($articles as $article) { ?>
						<div class="article-item row">
							<div class="col-xs-8 tit">
								<a href="/single/detail_<?php echo $article['ArticleId'] ?>.html"><?php echo $article['Title'] ?></a>
							</div>
							<div class="col-xs-4 do">
								<span><?php echo date('Y-m-d H:i:s', $article['CreateTime']) ?></span>&nbsp;&nbsp;
								<a href="/single/detail_<?php echo $article['ArticleId'] ?>.html">查看</a>
							</div>
						</div>
					<?php } ?>
				<?php } else { ?>
                    <h4 class="none">他一篇也没找到哦！</h4>
				<?php } ?>
			</div>
			<div class="col-xs-2 list-category">
				<div class="tit">分类（<?php echo $articlePager->count ?>）</div>
				<div class="list">
					<?php foreach($categoryInfoAndNumbers as $val) { ?>
						<a class="c1" href="javascript:;"><?php echo $val['CategoryName'] ?></a>
						<div class="item">
							<?php foreach($val['List'] as $v) { ?>
								<a class="c2" href="/dog/single_u<?php echo $userInfo['UserId'] ?>.html?c=<?php echo $v['CategoryId'] ?>"><?php echo $v['CategoryName'] ?>（<?php echo $v['Number'] ?>）</a>
							<?php } ?>
						</div>
					<?php } ?>
				</div>
			</div>
		</div>
	</div>
</div>
<div class="container">
	<div class="well dog-info">
		<p class="bg-title title">
			<span>Ta的信息</span>
		</p>
		<div class="desc">
			<dl>
				<dd>
					<div class="row">
						<div class="col-xs-12"><span class="t">家乡：</span><?php echo implode('', $userInfo['cityInfo']) ?></div>
						<div class="col-xs-4"><span class="t">品种：</span><?php echo $userInfo['breed'] ?></div>
						<div class="col-xs-8"><span class="t">是否绝育：</span><?php echo $userInfo['Sterilization'] ? '是' : '否' ?></div>
						<div class="col-xs-4"><span class="t">婚姻：</span>
							<?php if ($userInfo['HasChildren'] == \Data\User::HAS_CHILDREN_YES) { ?>
								已孕过
							<?php } else if ($userInfo['HasChildren'] == \Data\User::HAS_CHILDREN_NO) { ?>
								未孕过
							<?php } else if ($userInfo['HasChildren'] == \Data\User::HAS_CHILDREN_KEEP) { ?>
								保密
							<?php } ?>
						</div>
						<div class="col-xs-8"><span class="t">年龄：</span><?php echo \Util\User::getOld($userInfo['Birthday'])?>
						</div>
						<div class="col-xs-4"><span class="t">性别：</span><?php echo $userInfo['Sex'] == '1' ? 'GG' : 'MM' ?></div>
						<div class="col-xs-8"><span class="t">体重：</span><?php echo $userInfo['Weight'] ? $userInfo['Weight'] . '千克' : '' ?></div>
						<div class="col-xs-4"><span class="t">体长：</span><?php echo $userInfo['Length'] ? $userInfo['Length'] . '厘米' : '' ?></div>
						<div class="col-xs-8"><span class="t">肩高：</span><?php echo $userInfo['Height'] ?></div>
						<div class="col-xs-4"><span class="t">毛色：</span><?php echo $userInfo['Color'] ?></div>
						<div class="col-xs-8"><span class="t">饮食习惯：</span><?php if (in_array(\Data\User::EATING_HABITS_DOG_FOOD, explode(',', $userInfo['EatingHabits']))) { ?>
								<span class="">狗粮</span>
							<?php } ?>
							<?php if (in_array(\Data\User::EATING_HABITS_DOG_MIXED, explode(',', $userInfo['EatingHabits']))) { ?>
								<span class="">混合食物</span>
							<?php } ?>
							<?php if (in_array(\Data\User::EATING_HABITS_DOG_DIY, explode(',', $userInfo['EatingHabits']))) { ?>
								<span class="">自制狗粮</span>
							<?php } ?></div>
					</div>
				</dd>
			</dl>
		</div>
	</div>
	<div class="well dog-info">
		<p class="bg-title title">
			<span>Ta的交友条件</span>
		</p>
		<div class="desc">
			<dl>
				<dd>
					<div class="row">
						<div class="col-xs-4"><span class="t">品种：</span><?php echo $userCondition['breedNames'] ? $userCondition['breedNames'] : '不限' ?></div>
						<div class="col-xs-8"><span class="t">地区：</span><?php echo $userCondition['cityName'] ?></div>
						<div class="col-xs-4"><span class="t">年龄：</span><?php echo $userCondition['Age'] ? $userCondition['Age'] . '岁' : '不限' ?></div>
						<div class="col-xs-8"><span class="t">性别：</span><?php
							if ($userCondition['Sex'] == 1) {
								echo 'GG';
							} else if ($userCondition['Sex'] == 2) {
								echo 'MM';
							} else {
								echo '不限';
							}
							?></div>
						<div class="col-xs-4"><span class="t">体重：</span><?php echo $userCondition['Weight'] ? $userCondition['Weight'] . '千克' : '不限' ?></div>
						<div class="col-xs-8"><span class="t">体长：</span><?php echo $userCondition['Length'] ? $userCondition['Length'] . '厘米' : '不限' ?></div>
						<div class="col-xs-4"><span class="t">肩高：</span><?php echo $userCondition['Height'] ? $userCondition['Height'] . '厘米' : '不限' ?></div>
						<div class="col-xs-8"><span class="t">毛色：</span><?php echo $userCondition['Color'] ? $userCondition['Color'] : '不限' ?></div>
					</div>
				</dd>
			</dl>
		</div>
	</div>
	<div class="well dog-info">
		<p class="bg-title title">
			<span>Ta主人的资料</span>
		</p>
		<div class="desc">
			<?php if ($userMasterInfo) { ?>
				<dl>
					<dt><i class="glyphicon glyphicon-paperclip"></i>对主人的评价</dt>
					<dd><?php echo $userMasterInfo['Desc'] ?></dd>
				</dl>
				<dl>
					<dt><i class="glyphicon glyphicon-paperclip"></i>主人的详细资料</dt>
					<dd>
						<div class="row">
							<div class="col-xs-4"><span class="t">昵称：</span><?php echo $userMasterInfo['Nickname'] ?></div>
							<div class="col-xs-8"><span class="t">性别：</span><?php echo $userMasterInfo['Sex'] == 1 ? '帅哥' : '美女' ?></div>
							<div class="col-xs-4"><span class="t">年龄：</span><?php echo \Util\User::getOld($userMasterInfo['Birthday'])?></div>
							<div class="col-xs-8"><span class="t">养狗经验：</span><?php echo $userMasterInfo['Experience'] ? $userMasterInfo['Experience'] . '个月' : '-' ?></div>
							<div class="col-xs-4"><span class="t">职业：</span><?php echo $userMasterInfo['Profession'] ? $userMasterInfo['Profession'] : '-' ?></div>
							<div class="col-xs-8"><span class="t">狗狗个数：</span><?php echo $userMasterInfo['DogNumber'] ? $userMasterInfo['DogNumber'] . '个' : '-' ?></div>
						</div>
					</dd>
				</dl>
			<?php } else { ?>
				<dl><dt><h3>您还没有更新主人信息哦！</h3></dt></dl>
			<?php } ?>
		</div>
	</div>
	<div class="well dog-info">
		<p class="bg-title title">你可能感兴趣的？</p>
		<div class="desc dog-photo">
			<div>
				<?php foreach ($mbDogs as $val) { ?>
					<a href="/dog_u<?php echo $val['UserId'] ?>.html" class="thumbnail">
						<img src="<?php echo !empty($val['Photo']) ? \Util\User::getUserPhoto($val['Photo'], 200, 200) : '/Resource/images/nohead_new.jpg'; ?>">
					</a>
				<?php } ?>
			</div>

		</div>
	</div>
</div>
<?php $this->import('Footer') ?>
<script>
	seajs.init({
		userId: <?php echo $userInfo['UserId'] ?>
	});
</script>